function ret = main(sMethod, x, f)
#try
	if(validateInput(x))
		filename = strcat(tolower(sMethod), 'Weights', f);
		if(strcmp('AND',sMethod))
			w = load(filename);
			ret = normalizeOutput(simplePerceptron5(normalizeInput(x,1), w, f));	
		elseif(strcmp('OR',sMethod))
			w = load(filename);	
			ret = normalizeOutput(simplePerceptron5(normalizeInput(x,-1), w, f));
		else
			printf("'%s' is not a valid method.\n", sMethod);
		endif
		
	else
		printf("Invalid input.\n");
	endif
#catch
#	printf("Invalid parameters.\n");
#end_try_catch

endfunction
